package erfgame.core.graphics.renderer;


import erfgame.core.Rotation;
import erfgame.core.entity.Entity;
import erfgame.core.world.World;

public class PrototypingEntityRendererFactoryProxy implements EntityRendererFactory {

	private EntityRendererFactory proxied;
	
	public PrototypingEntityRendererFactoryProxy( EntityRendererFactory proxied ) {
		this.proxied = proxied;
	}
	
	public EntityRenderer getRenderer(World world, Entity entity, Rotation viewRotation ) {
		EntityRenderer prototype = this.proxied.getRenderer( world, entity, viewRotation );
		EntityRenderer result = ((PrototypeEntityRenderer)prototype).spawn(world, entity);
		return result;
	}

}
